package ${e.pkg};

<#list e.imports as imps>
import ${imps};
</#list>


/**
 *	Entity (${e.tableName})
 *  ${e.tableDesc!""}
 *
 *	@author ${e.author!""} (${e.authorEnglish!""})
 *	@date ${e.createTime}
 */
<#if e.swagger>
@ApiModel("${e.tableName}")
</#if>
public class ${e.className} implements Serializable {
    /**
     *
     */
    private static final long serialVersionUID = 1L;

<#list e.fields as field>
    /**
     *  ${field.desc!""}
     */
 <#if e.swagger>
    @ApiModelProperty("<#if field.desc?length gt 0>${field.desc}<#else>${field.name}</#if>")
 </#if>
    protected ${field.type} ${field.name};
</#list>


    public static ${e.className} build() {return new ${e.className}();}


<#list e.fields as field>
    public ${field.type} ${field.get}() {return ${field.name};}
    public void ${field.set}(${field.type} ${field.name}) { this.${field.name} = ${field.name}; }
    public ${e.className} ${field.name}(${field.type} ${field.name}) { this.${field.name} = ${field.name}; return this; }

</#list>

    /**
     *  是否为空
     *  <p> 仅仅是每个字段的为空检测。若存在特殊空判，需要自行实现
     */
    public boolean isEmpty() {
        <#list e.fields as field>
        if (this.${field.name} != null) {return false;}
        </#list>
        return true;
    }
    /**
     *  copy（注：这是浅拷贝）
     */
    public ${e.className} copy() {
        ${e.className} copy = new ${e.className}();
        <#list e.fields as field>
        copy.${field.name} = this.${field.name};
        </#list>
        return copy;
    }
}
